package model.service;

public class Device {
	
	private int device;
	private DeviceType deviceType;
	
	
	
	private String name;
	private String regNo;
	private String description;
	private String model;
	private String manufacturer;
	
	public Device(int device) {
		this.device = device;
	}
	
	public Device() {
	}
	
	public void setName(String name) {
		this.name = name;
	}
	public String getName() {
		return name;
	}
	public void setRegNo(String registrationNumber) {
		this.regNo = registrationNumber;
	}
	public String getRegNo() {
		return regNo;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getDescription() {
		return description;
	}
	public void setModel(String model) {
		this.model = model;
	}
	public String getModel() {
		return model;
	}
	public void setManufacturer(String manufacturer) {
		this.manufacturer = manufacturer;
	}
	public String getManufacturer() {
		return manufacturer;
	}
	public static String getTableHtmlHeader(){
		String html = new String("<header><th>Nimi</th><th>Registreerimise number</th><th>Kirjeldus</th><th>Mudel</th><th>Tootja</th></header>");
		return html;
	}
	public String getHtmlTableVersion(){
		String name = getName();
		String reg = getRegNo();
		String des = getDescription();
		String mod = getModel();
		String man = getManufacturer();
		if(name == null)
			name = "&nbsp";
		if(reg == null)
			reg = "&nbsp";
		if(des == null)
			des = "&nbsp";
		if(mod == null)
			mod = "&nbsp";
		if(man == null)
			man = "&nbsp";
		
		return "<td>"+name+"</td>"+"<td>"+reg+"</td>"+"<td>"+des+"</td>"+"<td>"+mod+"</td>"+"<td>"+man+"</td>";
	}
	public void setDevice(int device) {
		this.device = device;
	}
	public int getDevice() {
		return device;
	}
	public void setDeviceType(DeviceType deviceType) {
		this.deviceType = deviceType;
	}
	public DeviceType getDeviceType() {
		return deviceType;
	}

}
